<?php
// +-------------------------------------------------------------------
// |
// +-------------------------------------------------------------------
// | Copyright (c) 2009-2016 All rights reserved.
// +-------------------------------------------------------------------
namespace Service\Api\V1;

class UserInforSubmit
{
    public $login = true; //是否需要登录才能访问该接口
    public $title = "用户帖子提交ok";
    public $group = '帖子';
    public $desc = "";

    public $input = [
        'type' => 'required;int;label=类型id',
        'title' => 'label=标题;',
        'describe' => 'label=描述;;',
        'img' => 'label=图片;comment=多个使用英文逗号分隔;',
        'mobile' => 'label=联系电话',
        'contact' => 'label=联系人',
    ];

    public $output = [
    ];

    public function run($param, $uid)
    {

        $add = $param;
        $add['uid'] = $uid;
        $add['state'] = 1;
        $result = M('user_infor')->add($add);
        if($result){
            return [];
        }else{
           throw new \Exception('提交失败');
        }

    }
}
